package main

import (
	. "SGEngine2"
	"fmt"
)

func main() {
	View{
		Width:  1024,
		Height: 768,
		Title:  "gansikalubin",
		ViewScene: &Scene{
			InitFunc: InitScene,
			RootNode: ZeroNode(),
			Camera: Camera{
				CameraNode: ZeroNode(),
				BGColor:    Color3{0.5, 0.5, 0.5},
			}},
	}.Run()
}

func InitScene(scene *Scene) {
	ShaderFolderPath = "../../Shader/"
	tex := &Texture{ImageName: "2.png", Color: Color4{1, 1, 1, 1}}
	tex.Pivot = Pivot_BOTTOMLEFT
	znn := ZeroNode()
	znn.Scale = Vec3{1, 0.008, 1}
	scene.RootNode.AddChildComponent(znn, tex)

	font := NewFTFont("C:\\Windows\\Fonts\\msyh.ttf", 24)
	lb := &FTLabel{Font: font, Text: `_abcdefghijklmnopqrstwvuxyz`}
	lb.Color = Color4{1, 1, 1, 1}
	lb.Pivot = Pivot_BOTTOMLEFT
	zn := ZeroNode()

	em := &EventMessage{}
	em.RegisterEvent(EVENT_MOUSEDOWN, MouseDownLabel)
	em.RegisterEvent(EVENT_MOUSEUP, MouseUpLabel)
	zn.Add(em)
	zn.Add(lb)

	scene.RootNode.AddChild(zn)

}

func MouseDownLabel(em *EventMessage, x int, y int) {
	fmt.Println("GSKLB MouseDown")
}
func MouseUpLabel(em *EventMessage, x int, y int) {
	fmt.Println("GSKLB MouseUp")
}
